home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_500 / swindows / source / swsetup.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  78 lines

  1. /*
  2.  *  SWINDOWS    A program to allow you to open windows on any screen by
  3.  *              supplying the screen name in thw window title
  4.  *
  5.  *              Copyright 1989 by Davide P. Cervone.
  6.  *  You may use this code, provided this copywrite notice is kept intact.
  7.  */
  8.  
  9. #include "swHandler.h"
  10.  
  11.  
  12. struct IntuitionBase *IntuitionBase = NULL;
  13. struct SysBase *SysBase;
  14.  
  15.  
  16. /*
  17.  *  These are the assembly code stubs that replace the Intuition Library
  18.  *  vectors.  Thes stubs in turn call the C-language routines that actually
  19.  *  do the work.
  20.  */
  21.  
  22. extern void aOpenWindow();
  23. extern void aCloseWindow();
  24. extern void aCloseScreen();
  25.  
  26. /*
  27.  *  These are used by the assembly stubs to call the original routines when
  28.  *  needed.  They also are used to replace the Intution vectors when 
  29.  *  sWindows exits.
  30.  */
  31.  
  32. long OldOpenWindow;
  33. long OldCloseWindow;
  34. long OldCloseScreen;
  35.  
  36.  
  37. static struct swHandlerInfo swHandlerData =
  38. {
  39.    {                                            /* the MsgPort is pre-setup */
  40.       {NULL,NULL, NT_MSGPORT, 0, PORTNAME},     /*  to include the name and */
  41.       PA_IGNORE, 0, NULL,                       /*  type so that it can just */
  42.       {NULL,NULL,NULL, 0,0}                     /*  be added to the port list */
  43.    },                                           /*  so it can be founf later */
  44.    MAJVERS,MINVERS, 0,
  45.    NULL,
  46.    &IntuitionBase,
  47.    &SysBase,
  48.    
  49.    &ScreenList,
  50.    &WindowList,
  51.    
  52.    &aOpenWindow,
  53.    &aCloseWindow,
  54.    &aCloseScreen,
  55.    
  56.    &OldOpenWindow,
  57.    &OldCloseWindow,
  58.    &OldCloseScreen,
  59. };
  60.  
  61.  
  62. /*
  63.  *  Setup()
  64.  *
  65.  *  This routine MUST be linked into the sWindows-Handler executable 
  66.  *  as the first routine, so that the loader can find it.
  67.  *  It should check the version number for compatibility with the loader,
  68.  *  and should return NULL for an error, or the pointer to the shared
  69.  *  data structure if everything is OK.
  70.  */
  71.  
  72. struct swHandlerInfo *Setup(version)
  73. int version;
  74. {
  75.    if (version < MINLOADVER) return(NULL);
  76.    return(&swHandlerData);
  77. }
  78.